% flash and hogan's velocity profile generator.
% S is movement extent
% T is the movement time.
% v it the velocity
% 
hold off;
dt=.002;
for S=[2.5,5,10,20,30]
    vmax = 5.9*S+11.4; %cm/sec empirically from Figure 33-5 Kandell & Schwartz
    T=15/8*S/vmax;
    t=0:dt:T;
    v=15/8*S/T*(16*(t/T).^2-16*2*(t/T).^3+16*(t/T).^4);
    plot(t,v);
    hold on;
    cumsum(v*dt),
end

figure(2);
% try another function which fits the movement data better.
for S=[2.5,5,10,20,30]
    vmax = 5.9*S+11.4; %cm/sec empirically from Figure 33-5 Kandell & Schwartz
    T=15/8*S/vmax;
    t=0:dt:T*30;
    v= vmax*dt*dskt(t,0,1,-1);
    plot(t,v);
    hold on;
    cumsum(v*dt),
end

